home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_14_(11-1984).d64
/
3d tic tac toe
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
3KB
|
151 lines
1 PRINT"[159]"
100 B$="*******************"
110 A$=" "
120 PRINT"[147]"TAB(9)B$:PRINT" * 3-D TIC TAC TOE *":PRINTTAB(9)B$
130 IFF=1THEN00180
140 PRINT"DO YOU WANT INSTRUCTIONS?(Y/N)"
150 GETY$:IFY$=""THEN00150
160 IFY$="Y"THEN01420
170 PRINT"[145]"A$"[145][145]";
180 RESTORE:F=0
190 DIMA(75),B(75)
200 DIMG(63),V(63)
210 DIMN0(3),N1(3)
220 FORI=0TO75:READA(I):NEXTI
230 FORI=0TO75:READB(I):NEXTI
240 FORI=0TO3:READN0(I):NEXTI
250 FORI=0TO3:READN1(I):NEXTI
260 FORI=0TO63
270 G(I)=0
280 NEXTI
290 FORI=0TO63
300 V(I)=0
310 IFG(I)=0THEN00330
320 V(I)=-1
330 NEXTI
340 GOSUB00980
350 PRINT"LEVEL:?";
360 GETY$:IFY$=""THEN00360
370 IFASC(Y$)>52ORASC(Y$)<48THEN00360
380 L=VAL(Y$):PRINTL
390 PRINT"COLUMN:?";
400 GETY$:IFY$=""THEN00400
410 IFASC(Y$)>52ORASC(Y$)<48THEN00400
420 C=VAL(Y$):PRINTC
430 PRINT"ROW:?";
440 GETY$:IFY$=""THEN00440
450 IFY$="R"THENPRINT"[145][145][145]":PRINTA$:PRINTA$:PRINTA$"[145][145][145]":GOTO00350
460 IFASC(Y$)>52ORASC(Y$)<48THEN00440
470 R=VAL(Y$):PRINTR
480 P=16*R+4*L+C-21
490 IFP=-21THENRUN
500 IFV(P)=-1THENPRINT"[145][145][145]"A$:PRINTA$:PRINTA$"[145][145][145]":GOTO00350
510 G(P)=-1
520 V(P)=-1
530 GOSUB00980
540 N=-1
550 T=0
560 FORL=0TO75
570 S=A(L)
580 V1=B(L)
590 C=0
600 H=0
610 P=S-V1
620 FORI=0TO3
630 P=P+V1
640 IFG(P)<>1THEN00670
650 C=C+1
660 GOTO00690
670 IFG(P)<>-1THEN00690
680 H=H+1
690 NEXTI
700 IFH*C<>0THEN00810
710 T=T+1
720 IFH=4THEN01290
730 P=S-V1
740 FORI=0TO3
750 P=P+V1
760 IFV(P)=-1THEN00800
770 IFC<>3THEN00790
780 N=P
790 V(P)=V(P)+N0(H)+N1(C)
800 NEXTI
810 NEXTL
820 IFN<>-1THEN01310
830 IFT=0THEN01360
840 PRINTA$:PRINTA$:PRINTA$:PRINTA$
850 PRINTT" REMAINING LINES":PRINT
860 M=-1
870 FORI=0TO63
880 IFM>=V(I)THEN00910
890 M=V(I)+INT(RND(TI)*5)
900 P=I
910 NEXTI
920 PRINT"MY MOVE RATED AT:";M;
930 G(P)=1
940 PRINTTAB(24)"[145][145][145][145][145][145]LEVEL";INT(P/4)-4*INT(P/16)+1
950 PRINTTAB(24)"COLUMN";P-4*INT(P/4)+1
960 PRINTTAB(24)"ROW";INT(P/16)+1
970 GOTO00290
980 PRINT"":PRINT:PRINT:PRINT:PRINT
990 PRINT"LEVEL 1 LEVEL 2 LEVEL 3 LEVEL 4"
1000 PRINT
1010 FORR=1TO4
1020 FORL=1TO4
1030 FORC=1TO4
1040 P=16*R+4*L+C-21
1050 IFG(P)<>-1THEN01070
1060 PRINT"O";
1070 IFG(P)<>1THEN01090
1080 PRINT"X";
1090 IFG(P)<>0THEN01110
1100 PRINT" ";
1110 IFC<4THENPRINT"[221]";
1120 NEXTC
1130 PRINT" ";
1140 NEXTL
1150 IFR<4THENPRINT"[192][219][192][219][192][219][192] [192][219][192][219][192][219][192] [192][219][192][219][192][219][192] [192][219][192][219][192][219][192]"
1160 NEXTR
1170 PRINT
1180 RETURN
1190 DATA0,0,0,1,2,3,3,4,8,12,0,0,1,2,3,3,0,0,1,2,3,3,4,4,5,6,7,7,8,8
1200 DATA9,10,11,11,12,12,13,14,15,15,12,12,13,14,15,15,16,16,16,17,18
1210 DATA19,19,20,24,28,32,32,32,33,34,35,35,36,40,44,48,48,48,49,50
1220 DATA51,51,52,56,60
1230 DATA1,4,5,4,4,3,4,1,1,1,16,17,16,16,15,16,20,21,20,20,19,20,16,17
1240 DATA16,16,15,16,16,17,16,16,15,16,12,13,12,12,11,12,16,17,16,16
1250 DATA15,16,1,4,5,4,4,3,4,1,1,1,1,4,5,4,4,3,4,1,1,1,1,4,5,4,4,3,4
1260 DATA1,1,1
1270 DATA0,3,15,35
1280 DATA1,4,9,40
1290 PRINTA$:PRINTA$:PRINTA$:PRINT"YOU WIN"
1300 GOTO01370
1310 PRINTA$:PRINTA$:PRINTA$:PRINT"I WIN"
1320 G(N)=1
1330 GOSUB00980
1340 PRINT
1350 GOTO01370
1360 PRINTA$:PRINTA$:PRINTA$:PRINT"GAME DRAWN"
1370 PRINT"DO YOU WANT ANOTHER GAME?(Y/N)"
1380 GETY$:IFY$=""THEN01380
1390 IFY$="Y"THENPRINT"[145][145]"A$:PRINTA$:PRINTA$:PRINTA$:PRINTA$:PRINTA$:GOTO00260
1400 PRINT"[147]":PRINT:PRINT:PRINT:PRINT:PRINT:PRINTTAB(10)"GOODBYE"
1410 END
1420 F=1:PRINT"[145]THE GAME IS PLAYED ON A CUBE 4 [214] 4 [214] 4"
1430 PRINT"THE OBJECT IS TO TO GET A ROW OF 4'O'S"
1440 PRINT"IN ANY DIRECTION (INCLUDING) DIAGONALS"
1450 PRINT"YOU MUST ALSO STOP THE MACHINE GETTING"
1460 PRINT"A ROW OF 'X'S. YOU GO FIRST AND WILL BE"
1470 PRINT"[145]ASKED FOR THE LEVEL,COLUMN AND ROW IN"
1480 PRINT"WHICH YOU WANT TO PLAY. THE LEVELS ARE"
1490 PRINT"MARKED ON THE BOARD(1-4),THE COLUMNS ARE"
1500 PRINT"[145]NUMBERED ACROSS THE BOARD(1-4) AND THE"
1510 PRINT"ROWS ARE NUMBERED DOWN THE BOARD(1-4)"
1520 PRINT"IF YOU ENTER 0 TO ALL QUESTIONS THE"
1530 PRINT"BOARD IS RESET. IF YOU MAKE A MISTAKE"
1540 PRINT"ENTER 'R' IN ANSWER TO ROW? AND YOU"
1550 PRINT"CAN REENTER YOUR PLAY."
1560 PRINT:PRINT"PRESS ANY KEY"
1570 GETY$:IFY$=""THEN01570
1580 GOTO00120